<?php

require_once 'config.php';

function __autoload($class) {
    $file = $class. '.php';
    require_once(CORE_DIR . $file);
}

$ct = dxt_get("ct");
if (!$ct) {
    $ct = "index";
}
$fileController = CONTROLLER_DIR . ucfirst($ct) . 'Controller.php';

if (file_exists($fileController)) {
    require_once $fileController;
    $action = dxt_get("action");
    if (!$action) {
        $action = "index";
    }
    $class = ucfirst($ct).'Controller';
    
    $controller = new $class;
    $controller->setAction($action);
    $controller->execute();
}
?>